# 对mask文件进进行重命名 格式为000000_000000.jpg
import os
import cv2
import numpy as np
import sys
from tqdm import tqdm
from shutil import copyfile

def shuffle_files(sourch_folder,to_folder):
    length = len(os.listdir(sourch_folder))
    for i in tqdm(range(length)):
        file_path = os.path.join(sourch_folder, f"{i}.jpg")
        new_file_path = os.path.join(to_folder, '{:06d}_000000.jpg'.format(i))
        copyfile(file_path, new_file_path)


#E:\pose\datasets\col_datasets\mt\train
if __name__ == '__main__':
    folder = r'E:\pose\datasets\obj_ac\obj_000003\test\000001\mask'
    to_folder = r'E:\pose\datasets\obj_ac\obj_000003\test\000001\mask_visib'
    shuffle_files(folder,to_folder)
    print('Done')